define([
  'jquery',
  'underscore',
  'backbone',
  'views/TopbarView',
  'routers/RootRouter',
  'collections/Subscribers'
], function($, _, Backbone, TopbarView, SubscriberRouter, Subscribers) {
  function init() {
    console.log("--- APP INIT ---");
    console.log($);
    console.log(_);
    console.log(Backbone);
    console.log("----------------");

    /*var router = new MyRouter();
    Backbone.history.start();*/
    //    $("#container").html(template({var1: "test"}));
    // First common initializations.
    // Topbar
    var topbar = new TopbarView();
    // Next get an instance of a router.
    var router = new SubscriberRouter();
    // Finally call backbone history start method.
    Backbone.history.start();

   /* subscribers.add({name: "David1"});
    subscribers.add({name: "David2"});
    subscribers.add({name: "David3"});
    subscribers.add({name: "David4"});
    subscribers.add({name: "David5"});
    subscribers.add({name: "David6"});
    subscribers.add({name: "David7"});
    subscribers.add({name: "David8"});
    subscribers.add({name: "David9"});


    var pagination = subscribers.pagination();
    log(pagination);
    pagination.nextPage();
    log(pagination); */
  }

  return {
    init: init
  };
});